home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / comm / mail / YAM23src.lha / Source / extrasrc / astcsma.c next >
C/C++ Source or Header  |  2001-03-09  |  481b  |  19 lines

  1. #include <proto/dos.h>
  2. #include "extra.h"
  3. #include <stdlib.h>
  4. #include <string.h>
  5.  
  6. /* Not completely equivalent to the SAS/C version, as the returned value
  7.    is not the same. But YAM only uses the return value as a boolean. */
  8. int astcsma(const char *s, const char *p)
  9. {
  10.    int ret,len=strlen(p)*2+2;
  11.    char *buf=malloc(len);
  12.  
  13.    if(!buf) return 0;
  14.    if (ParsePatternNoCase(p, buf, len) < 0) ret=0;
  15.    else ret=MatchPatternNoCase(buf, (STRPTR)s);
  16.    free(buf);
  17.    return ret;
  18. }
  19.